'''
浅拷贝和深拷贝
两个有序列表合并
描述符协议
怎么实现获取一个对象的索引 __getitem__

事务隔离级别
mysql默认事务级别
事务是怎么实现的

单元测试 、集成测试

乐观锁和悲观锁
MySQL聚簇索引、非聚簇索引
自增id和uuid 做主键，两种情况的利弊
mysql 覆盖索引

left join 和 inner join

django 的关联查询select_related, prefetch_select
asyncio的实际作用

'''


def sort_(a, b):
    c = []
    for i in a:
        for v, j in enumerate(b):
            print(v,j)
            if j <= i:
                c.append(j)
            else:
                b = b[v:]
                break


        c.append(i)
    c += b
    return c


print(sort_([2,4,6,8],[3,5,7,9,22]))


def sort_by_price_ascending(json_string):
    import json
    json_string = json.loads(json_string)
    json_string = sorted(json_string, key=lambda x: (x['price'], x['name']))
    print(json.dumps(json_string))
    return json_string
sort_by_price_ascending('[{"name":"eggs","price":1},{"name":"coffee","price":9.99},{"name":"rice","price":9.99}]')

import re
def john_mary(str):
    john = re.compile(r'john')
    mary = re.compile(r'[M,m][A,a][R,r][Y,y]')
    # print(re.findall(john,str ))
    # print(re.findall(john, str))
    return len(john.findall(str)) == len(mary.findall(str))

print(john_mary('John&Mary&jOHn&MaRy'))